Skip to content
Open in github.dev Open in a new github.dev tab Open in codespace
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
0 / 55 files viewed
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -169,15 +169,15 @@ const setupMocks = async (page) => {
* @typedef {Object} TestScenario * @typedef {Object} TestScenario
* @prop {string} description * @prop {string} description
* @prop {{ * @prop {{
* channelGroup: $UTV.Channels.ChannelGroupType | null, * channelGroup: Channels.ChannelGroupType | null,
* channelTitle: string, * channelTitle: string,
* initialActiveGroup: $UTV.Channels.ChannelGroupType, * initialActiveGroup: Channels.ChannelGroupType,
* programDetailsMock: $ZAPI.EPG.PowerDetailsResponse * programDetailsMock: $ZAPI.EPG.PowerDetailsResponse
* }} setup * }} setup
* @prop {{ * @prop {{
* channelNumber: string, * channelNumber: string,
* notificationContent: string | null, * notificationContent: string | null,
* selectedGroup: $UTV.Channels.ChannelGroupType * selectedGroup: Channels.ChannelGroupType
* }} expected * }} expected
*/ */


@@ -351,3 +351,5 @@ test.describe('Active channel group', () => {
/** /**
* @import {UniversalPage, ZAPIInterceptor} from '#utv/e2e/playwright/test/universal/interfaces' * @import {UniversalPage, ZAPIInterceptor} from '#utv/e2e/playwright/test/universal/interfaces'
*/ */

/** @import {Channels} from '#utv/watch/interfaces'; */
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -73,7 +73,7 @@ export class ChannelList extends BasePage {
} }


/** /**
* @param {$UTV.Channels.ChannelGroupType} channelGroup * @param {Channels.ChannelGroupType} channelGroup
*/ */
async selectChannelGroup(channelGroup) { async selectChannelGroup(channelGroup) {
// open the groups menu and go up a bunch to ensure favorites is selected // open the groups menu and go up a bunch to ensure favorites is selected
@@ -104,7 +104,7 @@ export class ChannelList extends BasePage {
} }


/** /**
* @param {$UTV.Channels.ChannelGroupType} channelGroup * @param {Channels.ChannelGroupType} channelGroup
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
async verifyChannelGroupSelected(channelGroup) { async verifyChannelGroupSelected(channelGroup) {
@@ -117,3 +117,5 @@ export class ChannelList extends BasePage {
} }
} }
} }

/** @import {Channels} from '#utv/watch/interfaces'; */
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -97,5 +97,9 @@ export const ChannelListGroupList = (props) => {
); );
}; };


/** @import {Props} from './interfaces'; */ /**
/** @typedef {$RN.ListRenderItem<$UTV.ChannelList.GroupItem>} ListRenderItem */ * @import {Props} from './interfaces';
* @import {ChannelList} from '#utv/watch/interfaces';
*/

/** @typedef {$RN.ListRenderItem<ChannelList.GroupItem>} ListRenderItem */
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -19,5 +19,10 @@ export const groupsViewabilityConfig = {
itemVisiblePercentThreshold: 90, itemVisiblePercentThreshold: 90,
}; };


/** @typedef {$UTV.Watch.ChannelList.GroupItem} GroupItem */ /**
/** @typedef {$UTV.UI.LongList.LongListProps<GroupItem>} ListProps */ * @import {ChannelList} from '#utv/watch/interfaces';
* @import {LongList} from '#utv/ui/interfaces';
*/

/** @typedef {ChannelList.GroupItem} GroupItem */
/** @typedef {LongList.LongListProps<GroupItem>} ListProps */
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -120,7 +120,11 @@ export const ChannelListTeaserList = (props) => {
); );
}; };


/**
* @import {Props} from './interfaces';
* @import {LongList as LongListTypes} from '#utv/ui/interfaces';
*/

/** @typedef {$ZAPI.Channels.ChannelInfoV4} ChannelInfo */ /** @typedef {$ZAPI.Channels.ChannelInfoV4} ChannelInfo */
/** @typedef {$UTV.UI.LongList.LongListProps<ChannelInfo>} ListProps */ /** @typedef {LongListTypes.LongListProps<ChannelInfo>} ListProps */
/** @typedef {$UTV.UI.LongList.ListRenderItem<ChannelInfo>} ListRenderItem */ /** @typedef {LongListTypes.ListRenderItem<ChannelInfo>} ListRenderItem */
/** @import {Props} from './interfaces'; */
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -27,5 +27,7 @@ export const channelsKeyExtractor = (item) => {
return item.cid; return item.cid;
}; };


/** @import {LongList} from '#utv/ui/interfaces'; */

/** @typedef {$ZAPI.Channels.ChannelInfoV4} ChannelInfo */ /** @typedef {$ZAPI.Channels.ChannelInfoV4} ChannelInfo */
/** @typedef {$UTV.UI.LongList.LongListProps<ChannelInfo>} ListProps */ /** @typedef {LongList.LongListProps<ChannelInfo>} ListProps */
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -16,7 +16,7 @@ import {styles} from './styles';
* @type {React.FC<Props>} * @type {React.FC<Props>}
*/ */
export const LiveTime = memo((props) => { export const LiveTime = memo((props) => {
/** @type {$UTV.UI.Flag.OrchestratorFlagConfig[]} */ /** @type {Flag.OrchestratorFlagConfig[]} */
const flagsConfig = useMemo(() => { const flagsConfig = useMemo(() => {
return [ return [
props.replayAvailable ? { props.replayAvailable ? {
@@ -49,3 +49,5 @@ export const LiveTime = memo((props) => {
* @prop {number} endTime * @prop {number} endTime
* @prop {boolean} replayAvailable * @prop {boolean} replayAvailable
*/ */

/** @import {Flag} from '#utv/ui/interfaces'; */
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -194,8 +194,10 @@ export const ChannelListTeaser = memo((props) => {
); );
}); });


/** @import {ChannelList} from '#utv/watch/interfaces'; */

/** /**
* @typedef {$UTV.ChannelList.Teaser.Props} TeaserProps * @typedef {ChannelList.Teaser.Props} TeaserProps
* @typedef {$UTV.ChannelList.Teaser.FocusedProps} TeaserFocusedProps * @typedef {ChannelList.Teaser.FocusedProps} TeaserFocusedProps
* @typedef {$UTV.ChannelList.Teaser.UnfocusedProps} TeaserUnfocusedProps * @typedef {ChannelList.Teaser.UnfocusedProps} TeaserUnfocusedProps
*/ */
9 changes: 7 additions & 2 deletions projects/utv/src/watch/channel-list/index.jsx
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -281,7 +281,7 @@ export const ChannelList = () => {
setTimeoutActiveTrue, setTimeoutActiveTrue,
); );


/** @type {$UTV.NCE.NCECallback} */ /** @type {NCE.NCECallback} */
const handleNumericChannelEntry = useCallback((digits) => { const handleNumericChannelEntry = useCallback((digits) => {
onNCEHandle(digits, { onNCEHandle(digits, {
channelsListRef, channelsListRef,
@@ -316,7 +316,7 @@ export const ChannelList = () => {
}); });
}, [onChannelPress]); }, [onChannelPress]);


/** @type {$UTV.KeyHandler.KeyMapOptions} */ /** @type {KeyHandler.KeyMapOptions} */
const keyMapOptions = useMemo(() => { const keyMapOptions = useMemo(() => {
return { return {
keyMap: { keyMap: {
@@ -407,4 +407,9 @@ export const ChannelList = () => {
); );
}; };


/**
* @import {NCE} from '#utv/watch/interfaces';
* @import {KeyHandler} from '#utv/app/interfaces';
*/

/** @typedef {$ZAPI.Channels.ChannelInfoV4} ChannelInfo */ /** @typedef {$ZAPI.Channels.ChannelInfoV4} ChannelInfo */
14 changes: 8 additions & 6 deletions projects/utv/src/watch/channel-list/utils.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -113,7 +113,7 @@ export const getInitialFocusChannelIndex = (data, streamChannelId) => {
}; };


/** /**
* @param {$UTV.Watch.ChannelList.OnGroupParams} params * @param {ChannelList.OnGroupParams} params
* @param {number} nextGroupIndex * @param {number} nextGroupIndex
*/ */
const selectAndScrollToChannelBySelectingGroup = debounce((params, nextGroupIndex) => { const selectAndScrollToChannelBySelectingGroup = debounce((params, nextGroupIndex) => {
@@ -140,7 +140,7 @@ const selectAndScrollToChannelBySelectingGroup = debounce((params, nextGroupInde
scrollToChannelOffset(params.channelsListRef, nextChannelIndex, false); scrollToChannelOffset(params.channelsListRef, nextChannelIndex, false);
}, CHANNEL_SELECTION_DEBOUNCE_DELAY); }, CHANNEL_SELECTION_DEBOUNCE_DELAY);


/** @param {$UTV.Watch.ChannelList.OnGroupParams} params */ /** @param {ChannelList.OnGroupParams} params */
export const onGroupUp = (params) => { export const onGroupUp = (params) => {
params.setGroupIndex((prevGroupIndex) => { params.setGroupIndex((prevGroupIndex) => {
if (prevGroupIndex <= CHANNEL_LIST_GROUPS_FAVORITES_ID) { if (prevGroupIndex <= CHANNEL_LIST_GROUPS_FAVORITES_ID) {
@@ -155,7 +155,7 @@ export const onGroupUp = (params) => {
}); });
}; };


/** @param {$UTV.Watch.ChannelList.OnGroupParams} params */ /** @param {ChannelList.OnGroupParams} params */
export const onGroupDown = (params) => { export const onGroupDown = (params) => {
params.setGroupIndex((prevGroupIndex) => { params.setGroupIndex((prevGroupIndex) => {
if (prevGroupIndex >= params.groups.length - 1) { if (prevGroupIndex >= params.groups.length - 1) {
@@ -234,7 +234,7 @@ export const onChannelDown = (setChannelIndex, channelsListRef, currentDataRef)
}); });
}; };


/** @param {$UTV.Watch.ChannelList.OnRightParams} params */ /** @param {ChannelList.OnRightParams} params */
export const onRight = (params) => { export const onRight = (params) => {
if (params.isFavoritesSelectedRef.current) { if (params.isFavoritesSelectedRef.current) {
params.activeGroupIndexRef.current = CHANNEL_LIST_GROUPS_FAVORITES_ID; params.activeGroupIndexRef.current = CHANNEL_LIST_GROUPS_FAVORITES_ID;
@@ -259,7 +259,7 @@ export const onRight = (params) => {
}); });
}; };


/** @param {$UTV.Watch.ChannelList.OnLeftParams} params */ /** @param {ChannelList.OnLeftParams} params */
export const onLeft = (params) => { export const onLeft = (params) => {
params.setIsGroupsInFocus((prevIsGroupsInFocus) => { params.setIsGroupsInFocus((prevIsGroupsInFocus) => {
if (!prevIsGroupsInFocus) { if (!prevIsGroupsInFocus) {
@@ -280,7 +280,7 @@ export const onLeft = (params) => {


/** /**
* @param {string} digits * @param {string} digits
* @param {$UTV.Watch.ChannelList.OnNCEParams} params * @param {ChannelList.OnNCEParams} params
*/ */
export const onNCEHandle = (digits, params) => { export const onNCEHandle = (digits, params) => {
const channel = channelsLibUtils.getChannelByNumber( const channel = channelsLibUtils.getChannelByNumber(
@@ -314,3 +314,5 @@ export const onNCEHandle = (digits, params) => {
scrollToChannelOffset(params.channelsListRef, nceChannelIndex, false); scrollToChannelOffset(params.channelsListRef, nceChannelIndex, false);
} }
}; };

/** @import {ChannelList} from '#utv/watch/interfaces'; */
6 changes: 4 additions & 2 deletions projects/utv/src/watch/channels/actions.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -4,8 +4,8 @@ import * as sessionState from '#lib/session/state';


export const loadChannels = () => ( export const loadChannels = () => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} _dispatch * @param {$Redux.Dispatch<Store.Action>} _dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
* @returns {Promise<$Lib.Channels.ChannelsData>} * @returns {Promise<$Lib.Channels.ChannelsData>}
*/ */
async (_dispatch, getState) => { async (_dispatch, getState) => {
@@ -28,3 +28,5 @@ export const loadChannels = () => (
); );


export {setChannels} from '#lib/channels/actions'; export {setChannels} from '#lib/channels/actions';

/** @import {Store} from '#utv/app/interfaces' */
20 changes: 11 additions & 9 deletions projects/utv/src/watch/channels/slice.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -47,7 +47,7 @@ export const channelsSlice = createSlice({
}, },
initialState: { initialState: {
favoritesActive: favoritesActiveSlice.getInitialState(), favoritesActive: favoritesActiveSlice.getInitialState(),
/** @type {$UTV.Watch.Channels.ChannelGroupType | null} */ /** @type {Channels.ChannelGroupType | null} */
nextPlaybackChannelGroup: null, nextPlaybackChannelGroup: null,
}, },
name: 'watch/channels', name: 'watch/channels',
@@ -77,7 +77,7 @@ export const channelsSelectors = {
...sliceSelectors, ...sliceSelectors,


/** /**
* @param {$UTV.State} state * @param {Store.State} state
* @returns {$ZAPI.Channels.ChannelInfoV4[]} * @returns {$ZAPI.Channels.ChannelInfoV4[]}
*/ */
visibleChannelsGroup: (state) => { visibleChannelsGroup: (state) => {
@@ -87,7 +87,7 @@ export const channelsSelectors = {
}, },


/** /**
* @param {$UTV.State} state * @param {Store.State} state
* @param {string} cid * @param {string} cid
* @returns {string} * @returns {string}
*/ */
@@ -96,7 +96,7 @@ export const channelsSelectors = {
}, },


/** /**
* @param {$UTV.State} state * @param {Store.State} state
* @param {string} cid * @param {string} cid
* @returns {boolean} * @returns {boolean}
*/ */
@@ -110,7 +110,7 @@ export const channelsSelectors = {
/** /**
* @param {AppListenerEffectAPI} appListenerApi * @param {AppListenerEffectAPI} appListenerApi
* @param {string} channelId * @param {string} channelId
* @param {$UTV.Watch.Channels.ChannelGroupType} [channelGroup] * @param {Channels.ChannelGroupType} [channelGroup]
*/ */
const toggleChannelGroup = (appListenerApi, channelId, channelGroup) => { const toggleChannelGroup = (appListenerApi, channelId, channelGroup) => {
const state = appListenerApi.getState(); const state = appListenerApi.getState();
@@ -153,11 +153,11 @@ export const registerChannelsMiddleware = () => {


effect: (action, listenerApi) => { effect: (action, listenerApi) => {
const appListenerApi = /** @type {AppListenerEffectAPI} */ (listenerApi); const appListenerApi = /** @type {AppListenerEffectAPI} */ (listenerApi);
const state = /** @type {$UTV.State} */ (appListenerApi.getState()); const state = /** @type {Store.State} */ (appListenerApi.getState());


const typedAction = /** @type {$UTV.Watch.Player.Actions.SetPlayerData} */ const typedAction = /** @type {Player.Actions.SetPlayerData} */
(/** @type {unknown} */ (action)); (/** @type {unknown} */ (action));
const programDescriptor = /** @type {$UTV.Watch.Player.ProgramDescriptorWithID} */ ( const programDescriptor = /** @type {Player.ProgramDescriptorWithID} */ (
typedAction.data?.state?.stream?.programDescriptor typedAction.data?.state?.stream?.programDescriptor
); );
const channelId = programDescriptor?.streamingProgram?.cid; const channelId = programDescriptor?.streamingProgram?.cid;
@@ -181,7 +181,7 @@ export const registerChannelsMiddleware = () => {
listenerMiddleware.startListening({ listenerMiddleware.startListening({
type: FAVORITES_UPDATED, type: FAVORITES_UPDATED,
effect: (_action, listenerApi) => { effect: (_action, listenerApi) => {
const state = /** @type {$UTV.State} */ (listenerApi.getState()); const state = /** @type {Store.State} */ (listenerApi.getState());
const channelId = playerState.channelId(state); const channelId = playerState.channelId(state);
const favoritesCID = channelsLibState.favoritesCID(state); const favoritesCID = channelsLibState.favoritesCID(state);
const isFavoritesActive = channelsSelectors.selectFavoritesActive(state); const isFavoritesActive = channelsSelectors.selectFavoritesActive(state);
@@ -194,5 +194,7 @@ export const registerChannelsMiddleware = () => {
}; };


/** /**
* @import {Store} from '#utv/app/interfaces'
* @import {AppListenerEffectAPI} from '#utv/app/store/interfaces' * @import {AppListenerEffectAPI} from '#utv/app/store/interfaces'
* @import {Channels, Player} from '#utv/watch/interfaces'
*/ */
10 changes: 7 additions & 3 deletions projects/utv/src/watch/feedback-overlay/actions.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -18,12 +18,12 @@ import {
} from './enums'; } from './enums';


/** /**
* @param {$UTV.Watch.FeedbackOverlay.FeedbackOverlayAction} feedbackAction * @param {FeedbackOverlay.FeedbackOverlayAction} feedbackAction
*/ */
export const emitAction = (feedbackAction) => ( export const emitAction = (feedbackAction) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
(dispatch, getState) => { (dispatch, getState) => {
const state = getState(); const state = getState();
@@ -73,3 +73,7 @@ export const emitAction = (feedbackAction) => (
} }
} }
); );

/**
* @import {Store} from '#utv/app/interfaces'
* @import {FeedbackOverlay} from '#utv/watch/interfaces'; */
6 changes: 4 additions & 2 deletions projects/utv/src/watch/feedback-overlay/constants.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -8,8 +8,8 @@ export const FEEDBACK_OVERLAY_ANIMATION_DURATION = 300;


/** /**
* @type {Record< * @type {Record<
* $UTV.Watch.FeedbackOverlay.FeedbackOverlayAction, * FeedbackOverlay.FeedbackOverlayAction,
* $UTV.Watch.FeedbackOverlay.FeedbackOverlayActionData * FeedbackOverlay.FeedbackOverlayActionData
* >} * >}
*/ */
export const FeedbackActions = { export const FeedbackActions = {
@@ -44,3 +44,5 @@ export const FeedbackActions = {
soul: souls.FEEDBACK_OVERLAY_RESTART, soul: souls.FEEDBACK_OVERLAY_RESTART,
}, },
}; };

/** @import {FeedbackOverlay} from '#utv/watch/interfaces'; */
5 changes: 3 additions & 2 deletions projects/utv/src/watch/feedback-overlay/emitter.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -3,8 +3,9 @@ import EventEmitter from 'eventemitter3';
/** @type {EventEmitterType} */ /** @type {EventEmitterType} */
export const FeedbackOverlayEventEmitter = new EventEmitter(); export const FeedbackOverlayEventEmitter = new EventEmitter();


/** @typedef {EventEmitter<$UTV.Watch.FeedbackOverlay.EventTypes, unknown>} EventEmitterType */

/** /**
* @import {EventEmitter as EventEmitterType} from 'eventemitter3'; * @import {EventEmitter as EventEmitterType} from 'eventemitter3';
* @import {FeedbackOverlay} from '#utv/watch/interfaces';
*/ */

/** @typedef {EventEmitter<FeedbackOverlay.EventTypes, unknown>} EventEmitterType */
6 changes: 4 additions & 2 deletions projects/utv/src/watch/feedback-overlay/index.jsx
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -29,13 +29,13 @@ import * as souls from './souls';


/** @type {React.FC} */ /** @type {React.FC} */
export const FeedbackOverlay = memo(() => { export const FeedbackOverlay = memo(() => {
/** @type {$UseState<$UTV.FeedbackOverlay.FeedbackOverlayActionData>} */ /** @type {$UseState<FeedbackOverlayTypes.FeedbackOverlayActionData>} */
const [eventData, setEventData] = useState(null); const [eventData, setEventData] = useState(null);
const animatedRef = useRef(new Animated.Value(0)); const animatedRef = useRef(new Animated.Value(0));


useEffect(() => { useEffect(() => {
FeedbackOverlayEventEmitter.on(EventTypes.SET_ACTION, (action) => { FeedbackOverlayEventEmitter.on(EventTypes.SET_ACTION, (action) => {
/** @type {$UTV.FeedbackOverlay.FeedbackOverlayAction} */ /** @type {FeedbackOverlayTypes.FeedbackOverlayAction} */
const nextAction = action; const nextAction = action;


setEventData(FeedbackActions[nextAction]); setEventData(FeedbackActions[nextAction]);
@@ -92,3 +92,5 @@ export const FeedbackOverlay = memo(() => {
</Animated.View> </Animated.View>
); );
}); });

/** @import {FeedbackOverlay as FeedbackOverlayTypes} from '#utv/watch/interfaces'; */
4 changes: 3 additions & 1 deletion projects/utv/src/watch/feedback-overlay/utils.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -28,7 +28,7 @@ export const scaleInterpolation = {
}; };


/** /**
* @param {$UTV.Watch.FeedbackOverlay.FeedbackOverlayAction} action * @param {FeedbackOverlay.FeedbackOverlayAction} action
* @param {$Playback.UTVPlayerState} playerState * @param {$Playback.UTVPlayerState} playerState
* @returns {boolean} * @returns {boolean}
*/ */
@@ -50,3 +50,5 @@ export const isFeedbackActionAllowed = (action, playerState) => {
return false; return false;
} }
}; };

/** @import {FeedbackOverlay} from '#utv/watch/interfaces'; */
4 changes: 3 additions & 1 deletion projects/utv/src/watch/menu/data.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -118,7 +118,7 @@ export const menuDefaultOrder = [
]; ];


/** /**
* @type {Partial<Record<$UTV.Context.Funnel, string>>} * @type {Partial<Record<Context.Funnel, string>>}
*/ */
export const funnelMenuItemMap = { export const funnelMenuItemMap = {
[Funnel.CHANNELS]: MenuItem.CHANNELS, [Funnel.CHANNELS]: MenuItem.CHANNELS,
@@ -135,3 +135,5 @@ export const funnelMenuItemMap = {
}; };


/** @import {MenuDataItem} from './interfaces'; */ /** @import {MenuDataItem} from './interfaces'; */

/** @import {Context} from '#utv/app/interfaces'; */
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -16,7 +16,7 @@ import {EventTypes} from '#utv/app/focus/handler/enums';
export const useMenuOpenGesture = (disabled) => { export const useMenuOpenGesture = (disabled) => {
const lastFocusTimeRef = useRef(0); const lastFocusTimeRef = useRef(0);


/** @type {$UTV.KeyHandler.KeyMapOptions} */ /** @type {KeyHandler.KeyMapOptions} */
const keyMapOptions = useMemo(() => { const keyMapOptions = useMemo(() => {
return { return {
keyMap: { keyMap: {
@@ -45,3 +45,5 @@ export const useMenuOpenGesture = (disabled) => {
useAppKeyHandler(keyMapOptions, disabled); useAppKeyHandler(keyMapOptions, disabled);
useFocusHandler(focusEventsMapOptions, disabled); useFocusHandler(focusEventsMapOptions, disabled);
}; };

/** @import {KeyHandler} from '#utv/app/interfaces'; */
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -22,7 +22,7 @@ export const useMenuOpenGesture = (disabled) => {


const lastFocusTimeRef = useRef(0); const lastFocusTimeRef = useRef(0);


/** @type {$UTV.KeyHandler.KeyCallback} */ /** @type {KeyHandler.KeyCallback} */
const onAnyKeyPress = useCallback((event) => { const onAnyKeyPress = useCallback((event) => {
const nextTag = FocusManager.getFocused(); const nextTag = FocusManager.getFocused();


@@ -37,7 +37,7 @@ export const useMenuOpenGesture = (disabled) => {
lastTagRef.current = nextTag; lastTagRef.current = nextTag;
}, []); }, []);


/** @type {$UTV.KeyHandler.KeyMapOptions} */ /** @type {KeyHandler.KeyMapOptions} */
const keyMapOptions = useMemo(() => { const keyMapOptions = useMemo(() => {
return { return {
onAnyKey: onAnyKeyPress, onAnyKey: onAnyKeyPress,
@@ -59,3 +59,5 @@ export const useMenuOpenGesture = (disabled) => {
/** /**
* @import {TargetType} from '#utv/app/focus/handler/interfaces'; * @import {TargetType} from '#utv/app/focus/handler/interfaces';
*/ */

/** @import {KeyHandler} from '#utv/app/interfaces'; */
7 changes: 5 additions & 2 deletions projects/utv/src/watch/menu/index.jsx
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -154,7 +154,7 @@ export const Menu = () => {
} }
}, [homeId]); }, [homeId]);


/** @type {$UTV.KeyHandler.KeyMapOptions} */ /** @type {KeyHandler.KeyMapOptions} */
const keyMapOptions = useMemo(() => { const keyMapOptions = useMemo(() => {
return { return {
keyMap: { keyMap: {
@@ -217,4 +217,7 @@ export const Menu = () => {
); );
}; };


/** @import {MenuDataItem} from './interfaces'; */ /**
* @import {MenuDataItem} from './interfaces';
* @import {KeyHandler} from '#utv/app/interfaces';
*/
7 changes: 5 additions & 2 deletions projects/utv/src/watch/numeric-channel-entry/hook/index.jsx
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -7,12 +7,12 @@ import {navigationRef} from '#utv/app/navigation';
import {NUMERIC_CHANNEL_ENTRY_PAGE} from '../paths'; import {NUMERIC_CHANNEL_ENTRY_PAGE} from '../paths';


/** /**
* @param {$UTV.NCE.NCECallback} callback * @param {NCE.NCECallback} callback
* @param {boolean} [disabled] * @param {boolean} [disabled]
* @returns {void} * @returns {void}
*/ */
export const useNumericChannelEntry = (callback, disabled) => { export const useNumericChannelEntry = (callback, disabled) => {
/** @type {$UTV.KeyHandler.KeyMapOptions} */ /** @type {KeyHandler.KeyMapOptions} */
const keyMapOptions = useMemo(() => { const keyMapOptions = useMemo(() => {
/** @type {(initialNumber: number) => void} */ /** @type {(initialNumber: number) => void} */
const navigateToNCE = (initialNumber) => { const navigateToNCE = (initialNumber) => {
@@ -40,3 +40,6 @@ export const useNumericChannelEntry = (callback, disabled) => {


useKeyHandler(keyMapOptions, disabled); useKeyHandler(keyMapOptions, disabled);
}; };

/** @import {NCE} from '#utv/watch/interfaces'; */
/** @import {KeyHandler} from '#utv/app/interfaces'; */
7 changes: 5 additions & 2 deletions projects/utv/src/watch/numeric-channel-entry/index.jsx
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -78,7 +78,7 @@ export const NumericChannelEntry = (props) => {
}); });
}, [triggerAction]); }, [triggerAction]);


/** @type {$UTV.KeyHandler.KeyMapOptions} */ /** @type {KeyHandler.KeyMapOptions} */
const keyMapOptions = useMemo(() => { const keyMapOptions = useMemo(() => {
return { return {
keyMap: { keyMap: {
@@ -138,4 +138,7 @@ export const NumericChannelEntry = (props) => {
); );
}; };


/** @import {Props} from './interfaces' */ /**
* @import {Props} from './interfaces'
* @import {KeyHandler} from '#utv/app/interfaces';
*/
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -83,7 +83,7 @@ export const AudioSubtitleDialogue = () => {
navigation.goBack(); navigation.goBack();
}, [navigation, setSubtitleTrack]); }, [navigation, setSubtitleTrack]);


/** @type {$UTV.KeyHandler.KeyMapOptions} */ /** @type {KeyHandler.KeyMapOptions} */
const keyMapOptions = useMemo(() => { const keyMapOptions = useMemo(() => {
return { return {
keyMap: { keyMap: {
@@ -133,3 +133,5 @@ export const AudioSubtitleDialogue = () => {
</View> </View>
); );
}; };

/** @import {KeyHandler} from '#utv/app/interfaces'; */
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -31,7 +31,7 @@ export const NextProgram = () => {
const currentProgram = useSelector(playerState.streamingProgram); const currentProgram = useSelector(playerState.streamingProgram);
const streamType = useSelector(playerState.streamType); const streamType = useSelector(playerState.streamType);
const lineupHash = useSelector(sessionState.luhash); const lineupHash = useSelector(sessionState.luhash);
const upcomingProgram = useSelector((/** @type {$UTV.State} */ state) => { const upcomingProgram = useSelector((/** @type {Store.State} */ state) => {
if (!cid) { if (!cid) {
return null; return null;
} }
@@ -85,3 +85,5 @@ export const NextProgram = () => {
</View> </View>
); );
}; };

/** @import {Store} from '#utv/app/interfaces' */
4 changes: 3 additions & 1 deletion projects/utv/src/watch/osd/components/toolbar/index.jsx
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -104,7 +104,7 @@ export const Toolbar = (props) => {
* @prop {VoidFunction} onRestartPress * @prop {VoidFunction} onRestartPress
* @prop {VoidFunction} onLivePress * @prop {VoidFunction} onLivePress
* @prop {VoidFunction} onInfoPress * @prop {VoidFunction} onInfoPress
* @prop {$UTV.Recordings.ControlConfig} recordingControl * @prop {Recordings.ControlConfig} recordingControl
* @prop {boolean} hasReplay * @prop {boolean} hasReplay
* @prop {boolean} hasLive * @prop {boolean} hasLive
* @prop {boolean} hasRecording * @prop {boolean} hasRecording
@@ -114,3 +114,5 @@ export const Toolbar = (props) => {
* @prop {VoidFunction} onInfoButtonFocus * @prop {VoidFunction} onInfoButtonFocus
* @prop {$Playback.UTVPlayerStreamType} streamType * @prop {$Playback.UTVPlayerStreamType} streamType
*/ */

/** @import {Recordings} from '#utv/user/interfaces'; */
4 changes: 3 additions & 1 deletion projects/utv/src/watch/osd/full/index.jsx
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -218,7 +218,7 @@ export const FullOSD = () => {
ultraFastHandler: () => seekForward(SEEK_ULTRA_FAST_FORWARD_STEP_COUNT), ultraFastHandler: () => seekForward(SEEK_ULTRA_FAST_FORWARD_STEP_COUNT),
}); });


/** @type {$UTV.KeyHandler.KeyMapOptions} */ /** @type {KeyHandler.KeyMapOptions} */
const keyMapOptions = useMemo(() => { const keyMapOptions = useMemo(() => {
const canKeyUpCanCloseOSD = const canKeyUpCanCloseOSD =
// UP event when focus is on ProgressBar and theres no skipAdButton // UP event when focus is on ProgressBar and theres no skipAdButton
@@ -365,3 +365,5 @@ export const FullOSD = () => {
</AnimatedOverlay> </AnimatedOverlay>
); );
}; };

/** @import {KeyHandler} from '#utv/app/interfaces'; */
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -95,7 +95,7 @@ export const useMultiLevelAcceleratedLongPressHandler = (params) => {
}; };
}, [])); }, []));


const keyHandler = useCallback((/** @type {$UTV.KeyHandler.TvKeyEvent} */ evt) => { const keyHandler = useCallback((/** @type {KeyHandler.TvKeyEvent} */ evt) => {
if (evt.type === KeyEventTypes.KEY_DOWN) { if (evt.type === KeyEventTypes.KEY_DOWN) {
if (extFuncOnKeyDown) { if (extFuncOnKeyDown) {
extFuncOnKeyDown(); extFuncOnKeyDown();
@@ -157,3 +157,5 @@ export const useMultiLevelAcceleratedLongPressHandler = (params) => {
predictedCurrentMs, predictedCurrentMs,
}; };
}; };

/** @import {KeyHandler} from '#utv/app/interfaces'; */
133 changes: 68 additions & 65 deletions projects/utv/src/watch/player/actions/index.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -78,7 +78,7 @@ export const getBufferedPlay = () => {
}; };


/** /**
* @param {$UTV.State} state * @param {Store.State} state
* @returns {boolean} * @returns {boolean}
*/ */
const isPlayerReady = (state) => { const isPlayerReady = (state) => {
@@ -88,7 +88,7 @@ const isPlayerReady = (state) => {
}; };


/** /**
* @param {$UTV.State} state * @param {Store.State} state
* @returns {Partial<$Playback.UTVPlayerPlayOptions>} * @returns {Partial<$Playback.UTVPlayerPlayOptions>}
*/ */
const getBaseOptions = (state) => { const getBaseOptions = (state) => {
@@ -103,7 +103,7 @@ const getBaseOptions = (state) => {
}; };


/** /**
* @param {$UTV.State} state * @param {Store.State} state
* @returns {boolean} * @returns {boolean}
*/ */
export const isPlaybackActiveOrPlayRequested = (state) => { export const isPlaybackActiveOrPlayRequested = (state) => {
@@ -121,8 +121,8 @@ export const isPlaybackActiveOrPlayRequested = (state) => {
*/ */
const confirmUnsyncStreamLeave = (action) => ( const confirmUnsyncStreamLeave = (action) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
(dispatch, getState) => { (dispatch, getState) => {
const state = getState(); const state = getState();
@@ -147,13 +147,13 @@ const confirmUnsyncStreamLeave = (action) => (
); );


/** /**
* @param {$UTV.Watch.Player.PlayLiveOptions} options * @param {Player.PlayLiveOptions} options
* @param {$UTV.Watch.Player.PlayAdditionalArgs} [additionalArgs] * @param {Player.PlayAdditionalArgs} [additionalArgs]
*/ */
export const playLive = (options, additionalArgs = {}) => ( export const playLive = (options, additionalArgs = {}) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
async (dispatch, getState) => { async (dispatch, getState) => {
if (additionalArgs.showFeedback) { if (additionalArgs.showFeedback) {
@@ -221,8 +221,8 @@ export const playLive = (options, additionalArgs = {}) => (


export const handleStreamError = () => ( export const handleStreamError = () => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
(dispatch, getState) => { (dispatch, getState) => {
const state = getState(); const state = getState();
@@ -264,12 +264,12 @@ export const handleStreamError = () => (
}); });


/** /**
* @param {$UTV.Watch.Player.PlayReplayOptions} options * @param {Player.PlayReplayOptions} options
*/ */
export const playReplay = (options) => ( export const playReplay = (options) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
async (dispatch, getState) => { async (dispatch, getState) => {
const state = getState(); const state = getState();
@@ -351,12 +351,12 @@ export const playReplay = (options) => (
}); });


/** /**
* @param {$UTV.Watch.Player.PlayRecordingOptions} options * @param {Player.PlayRecordingOptions} options
*/ */
export const playRecording = (options) => ( export const playRecording = (options) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
async (dispatch, getState) => { async (dispatch, getState) => {
const state = getState(); const state = getState();
@@ -449,12 +449,12 @@ export const playRecording = (options) => (
}); });


/** /**
* @param {$UTV.Watch.Player.PlayVodOptions} options * @param {Player.PlayVodOptions} options
*/ */
export const playVodMovie = (options) => ( export const playVodMovie = (options) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
async (dispatch, getState) => { async (dispatch, getState) => {
const appDispatch = /** @type {AppDispatch} */ (dispatch); const appDispatch = /** @type {AppDispatch} */ (dispatch);
@@ -525,12 +525,12 @@ export const playVodMovie = (options) => (
}); });


/** /**
* @param {$UTV.Watch.Player.PlayVodOptions} options * @param {Player.PlayVodOptions} options
*/ */
export const playVodEpisode = (options) => ( export const playVodEpisode = (options) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
async (dispatch, getState) => { async (dispatch, getState) => {
const state = getState(); const state = getState();
@@ -611,7 +611,7 @@ export const playVodEpisode = (options) => (


export const play = () => ( export const play = () => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
*/ */
(dispatch) => { (dispatch) => {
dispatch(feedbackOverlayActions.emitAction(FeedbackOverlayAction.PLAY)); dispatch(feedbackOverlayActions.emitAction(FeedbackOverlayAction.PLAY));
@@ -648,8 +648,8 @@ export const trackPauseAdTenSecondsDisplayed = () => (
*/ */
export const pause = (autoPause) => ( export const pause = (autoPause) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
(dispatch, getState) => { (dispatch, getState) => {
if (!autoPause) { if (!autoPause) {
@@ -666,8 +666,8 @@ export const pause = (autoPause) => (


export const pauseOrStopPlayback = () => ( export const pauseOrStopPlayback = () => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
(dispatch, getState) => { (dispatch, getState) => {
const state = getState(); const state = getState();
@@ -684,8 +684,8 @@ export const pauseOrStopPlayback = () => (


export const playPause = () => ( export const playPause = () => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
(dispatch, getState) => { (dispatch, getState) => {
const state = getState(); const state = getState();
@@ -702,8 +702,8 @@ export const playPause = () => (


export const playFromStart = () => ( export const playFromStart = () => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
(dispatch, getState) => { (dispatch, getState) => {
const state = getState(); const state = getState();
@@ -742,7 +742,7 @@ export const playFromStart = () => (


export const seekForward = (seekStep = SEEK_FORWARD_STEP_COUNT) => ( export const seekForward = (seekStep = SEEK_FORWARD_STEP_COUNT) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
*/ */
(dispatch) => { (dispatch) => {
dispatch(feedbackOverlayActions.emitAction(FeedbackOverlayAction.FORWARD)); dispatch(feedbackOverlayActions.emitAction(FeedbackOverlayAction.FORWARD));
@@ -752,7 +752,7 @@ export const seekForward = (seekStep = SEEK_FORWARD_STEP_COUNT) => (


export const seekBackward = (seekStep = SEEK_BACKWARD_STEP_COUNT) => ( export const seekBackward = (seekStep = SEEK_BACKWARD_STEP_COUNT) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
*/ */
(dispatch) => { (dispatch) => {
dispatch(feedbackOverlayActions.emitAction(FeedbackOverlayAction.BACKWARD)); dispatch(feedbackOverlayActions.emitAction(FeedbackOverlayAction.BACKWARD));
@@ -775,8 +775,8 @@ export const seekToAdBreakEnd = () => (
*/ */
export const setSubtitleTrack = (trackId) => ( export const setSubtitleTrack = (trackId) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
(dispatch, getState) => { (dispatch, getState) => {
const state = getState(); const state = getState();
@@ -796,8 +796,8 @@ export const setSubtitleTrack = (trackId) => (
*/ */
export const setAudioTrack = (trackId) => ( export const setAudioTrack = (trackId) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
(dispatch, getState) => { (dispatch, getState) => {
const state = getState(); const state = getState();
@@ -819,7 +819,7 @@ export const setAudioTrack = (trackId) => (


/** /**
* @param {$Playback.UTVPlayerEventData} data * @param {$Playback.UTVPlayerEventData} data
* @returns {$UTV.Watch.Player.Actions.SetPlayerData} * @returns {Player.Actions.SetPlayerData}
*/ */
export const setPlayerData = (data) => { export const setPlayerData = (data) => {
return { return {
@@ -829,7 +829,7 @@ export const setPlayerData = (data) => {
}; };


/** /**
* @returns {$UTV.Watch.Player.Actions.PlayerDestroy} * @returns {Player.Actions.PlayerDestroy}
*/ */
export const playerDestroy = () => { export const playerDestroy = () => {
return { return {
@@ -838,7 +838,7 @@ export const playerDestroy = () => {
}; };


/** /**
* @param {$UTV.State} state * @param {Store.State} state
* @param {number} positionSwitchNumber * @param {number} positionSwitchNumber
* @returns {string | null} * @returns {string | null}
*/ */
@@ -867,8 +867,8 @@ const getNextChannelId = (state, positionSwitchNumber) => {
*/ */
export const zapDirection = (direction) => ( export const zapDirection = (direction) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
(dispatch, getState) => { (dispatch, getState) => {
const state = getState(); const state = getState();
@@ -889,8 +889,8 @@ export const zapDirection = (direction) => (
*/ */
export const playFromPreviousState = (pin) => ( export const playFromPreviousState = (pin) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
(dispatch, getState) => { (dispatch, getState) => {
const state = getState(); const state = getState();
@@ -978,8 +978,8 @@ export const playFromPreviousState = (pin) => (
*/ */
export const zapNumeric = (channelNumber) => ( export const zapNumeric = (channelNumber) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
(dispatch, getState) => { (dispatch, getState) => {
const state = getState(); const state = getState();
@@ -1027,8 +1027,8 @@ const LIVE_AND_TIMESHIFT = [
*/ */
export const playLiveFromDeepLink = (cid) => ( export const playLiveFromDeepLink = (cid) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
(dispatch, getState) => { (dispatch, getState) => {
const state = getState(); const state = getState();
@@ -1052,8 +1052,8 @@ export const playLiveFromDeepLink = (cid) => (
*/ */
export const playReplayFromDeepLink = (cid, pid) => ( export const playReplayFromDeepLink = (cid, pid) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
(dispatch, getState) => { (dispatch, getState) => {
const state = getState(); const state = getState();
@@ -1078,8 +1078,8 @@ export const playReplayFromDeepLink = (cid, pid) => (
*/ */
export const playRecordingFromDeepLink = (recordingId) => ( export const playRecordingFromDeepLink = (recordingId) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
(dispatch, getState) => { (dispatch, getState) => {
const state = getState(); const state = getState();
@@ -1108,8 +1108,8 @@ export const playRecordingFromDeepLink = (recordingId) => (
*/ */
export const playVodEpisodeFromDeepLink = (episodeId) => ( export const playVodEpisodeFromDeepLink = (episodeId) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
(dispatch, getState) => { (dispatch, getState) => {
const state = getState(); const state = getState();
@@ -1139,8 +1139,8 @@ export const playVodEpisodeFromDeepLink = (episodeId) => (
*/ */
export const playVodMovieFromDeepLink = (movieId) => ( export const playVodMovieFromDeepLink = (movieId) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
(dispatch, getState) => { (dispatch, getState) => {
const state = getState(); const state = getState();
@@ -1167,8 +1167,8 @@ export const playVodMovieFromDeepLink = (movieId) => (


export const cueNext = () => ( export const cueNext = () => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
async (dispatch, getState) => { async (dispatch, getState) => {
const state = getState(); const state = getState();
@@ -1271,12 +1271,12 @@ export const cueNext = () => (
); );


/** /**
* @param {$UTV.Watch.Player.StreamPathData} [data] * @param {Player.StreamPathData} [data]
*/ */
export const navigateToStream = (data) => ( export const navigateToStream = (data) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} _dispatch * @param {$Redux.Dispatch<Store.Action>} _dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
(_dispatch, getState) => { (_dispatch, getState) => {
const navigationState = navigationRef.getState(); const navigationState = navigationRef.getState();
@@ -1358,7 +1358,7 @@ export const setStatsForNerds = (enabled) => (


/** /**
* @param {boolean} enabled * @param {boolean} enabled
* @returns {$Redux.Dispatch<$UTV.Action>} * @returns {$Redux.Dispatch<Store.Action>}
*/ */
export const setPersistentOsd = (enabled) => { export const setPersistentOsd = (enabled) => {
return storageActions.setItem(StorageKey.PERSISTENT_OSD, enabled); return storageActions.setItem(StorageKey.PERSISTENT_OSD, enabled);
@@ -1368,10 +1368,13 @@ export * from '../messages/actions';


/** /**
* @callback Action * @callback Action
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */


/** /**
* @import {Store} from '#utv/app/interfaces'
* @import {AppDispatch} from '#utv/app/store/interfaces' * @import {AppDispatch} from '#utv/app/store/interfaces'
*/ */

/** @import {Player} from '#utv/watch/interfaces'; */
10 changes: 6 additions & 4 deletions projects/utv/src/watch/player/actions/initialization.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -15,8 +15,8 @@ import {


export const playOnInitialized = () => ( export const playOnInitialized = () => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
(dispatch, getState) => { (dispatch, getState) => {
const bufferedPlay = getBufferedPlay(); const bufferedPlay = getBufferedPlay();
@@ -58,6 +58,8 @@ export * from '../messages/actions';


/** /**
* @callback Action * @callback Action
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */

/** @import {Store} from '#utv/app/interfaces' */
12 changes: 7 additions & 5 deletions projects/utv/src/watch/player/hooks/player-methods.jsx
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -11,27 +11,27 @@ export const usePlayerMethods = () => {
dispatch(actions.play()); dispatch(actions.play());
}, [dispatch]); }, [dispatch]);


/** @type {(options: $UTV.Player.PlayLiveOptions, additionalArgs?: $UTV.Player.PlayAdditionalArgs) => void} */ /** @type {(options: Player.PlayLiveOptions, additionalArgs?: Player.PlayAdditionalArgs) => void} */
const playLive = useCallback((options, additionalArgs) => { const playLive = useCallback((options, additionalArgs) => {
dispatch(actions.playLive(options, additionalArgs)); dispatch(actions.playLive(options, additionalArgs));
}, [dispatch]); }, [dispatch]);


/** @type {(options: $UTV.Player.PlayReplayOptions) => void} */ /** @type {(options: Player.PlayReplayOptions) => void} */
const playReplay = useCallback((options) => { const playReplay = useCallback((options) => {
dispatch(actions.playReplay(options)); dispatch(actions.playReplay(options));
}, [dispatch]); }, [dispatch]);


/** @type {(options: $UTV.Player.PlayRecordingOptions) => void} */ /** @type {(options: Player.PlayRecordingOptions) => void} */
const playRecording = useCallback((options) => { const playRecording = useCallback((options) => {
dispatch(actions.playRecording(options)); dispatch(actions.playRecording(options));
}, [dispatch]); }, [dispatch]);


/** @type {(options: $UTV.Player.PlayVodOptions) => void} */ /** @type {(options: Player.PlayVodOptions) => void} */
const playVodMovie = useCallback((options) => { const playVodMovie = useCallback((options) => {
dispatch(actions.playVodMovie(options)); dispatch(actions.playVodMovie(options));
}, [dispatch]); }, [dispatch]);


/** @type {(options: $UTV.Player.PlayVodOptions) => void} */ /** @type {(options: Player.PlayVodOptions) => void} */
const playVodEpisode = useCallback((options) => { const playVodEpisode = useCallback((options) => {
dispatch(actions.playVodEpisode(options)); dispatch(actions.playVodEpisode(options));
}, [dispatch]); }, [dispatch]);
@@ -119,3 +119,5 @@ export const usePlayerMethods = () => {
zapPrevious, zapPrevious,
}; };
}; };

/** @import {Player} from '#utv/watch/interfaces'; */
4 changes: 3 additions & 1 deletion projects/utv/src/watch/player/interfaces.ts
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -8,6 +8,8 @@ import {
} from '@zattoo/playback-sdk-react-native-zapi'; } from '@zattoo/playback-sdk-react-native-zapi';
import {DetailedCompressedProgramInfo} from '@zattoo/zapi/lib/epg/interfaces'; import {DetailedCompressedProgramInfo} from '@zattoo/zapi/lib/epg/interfaces';


import type {Recordings} from '#utv/user/interfaces';

import * as actionTypes from './action-types'; import * as actionTypes from './action-types';


export type StreamOptionsWithoutType<T> = Omit<T, 'streamType'>; export type StreamOptionsWithoutType<T> = Omit<T, 'streamType'>;
@@ -19,7 +21,7 @@ export interface ProgramDescriptorWithID {
streamingProgram?: DetailedCompressedProgramInfo; streamingProgram?: DetailedCompressedProgramInfo;
movie?: $ZAPI.VOD.Movie; movie?: $ZAPI.VOD.Movie;
episode?: $ZAPI.VOD.Episode; episode?: $ZAPI.VOD.Episode;
recording?: $UTV.Recordings.RecordingInfo; recording?: Recordings.RecordingInfo;
isPinApplied?: boolean; isPinApplied?: boolean;
videoToken?: string; // for VOD content, used for tracking videoToken?: string; // for VOD content, used for tracking
isContinuous?: boolean; // for continuous playback isContinuous?: boolean; // for continuous playback
20 changes: 11 additions & 9 deletions projects/utv/src/watch/player/messages/actions.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -9,7 +9,7 @@ import * as souls from './souls';


export const showQualityReducedNotification = () => ( export const showQualityReducedNotification = () => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
*/ */
(dispatch) => { (dispatch) => {
dispatch(removeAllNotificationsByContent(souls.NOTIFICATION_QUALITY_REDUCED)); dispatch(removeAllNotificationsByContent(souls.NOTIFICATION_QUALITY_REDUCED));
@@ -23,7 +23,7 @@ export const showQualityReducedNotification = () => (


export const showLiveUnavailableNotification = () => ( export const showLiveUnavailableNotification = () => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
*/ */
(dispatch) => { (dispatch) => {
dispatch(setNotification({ dispatch(setNotification({
@@ -35,7 +35,7 @@ export const showLiveUnavailableNotification = () => (


export const showContinuousReplayUnavailableNotification = () => ( export const showContinuousReplayUnavailableNotification = () => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
*/ */
(dispatch) => { (dispatch) => {
dispatch(setNotification({ dispatch(setNotification({
@@ -47,7 +47,7 @@ export const showContinuousReplayUnavailableNotification = () => (


export const showContentUnplayableNotification = () => ( export const showContentUnplayableNotification = () => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
*/ */
(dispatch) => { (dispatch) => {
dispatch(setNotification({ dispatch(setNotification({
@@ -59,7 +59,7 @@ export const showContentUnplayableNotification = () => (


export const showPauseUnavailableNotification = () => ( export const showPauseUnavailableNotification = () => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
*/ */
(dispatch) => { (dispatch) => {
dispatch(setNotification({ dispatch(setNotification({
@@ -71,7 +71,7 @@ export const showPauseUnavailableNotification = () => (


export const showSkipBackwardUnavailableNotification = () => ( export const showSkipBackwardUnavailableNotification = () => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
*/ */
(dispatch) => { (dispatch) => {
dispatch(setNotification({ dispatch(setNotification({
@@ -83,7 +83,7 @@ export const showSkipBackwardUnavailableNotification = () => (


export const showSkipForwardUnavailableNotification = () => ( export const showSkipForwardUnavailableNotification = () => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
*/ */
(dispatch) => { (dispatch) => {
dispatch(setNotification({ dispatch(setNotification({
@@ -95,7 +95,7 @@ export const showSkipForwardUnavailableNotification = () => (


export const showSkipForwardLimitedNotification = () => ( export const showSkipForwardLimitedNotification = () => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
*/ */
(dispatch) => { (dispatch) => {
dispatch(setNotification({ dispatch(setNotification({
@@ -107,7 +107,7 @@ export const showSkipForwardLimitedNotification = () => (


export const showSkipBackwardLimitedNotification = () => ( export const showSkipBackwardLimitedNotification = () => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
*/ */
(dispatch) => { (dispatch) => {
dispatch(setNotification({ dispatch(setNotification({
@@ -116,3 +116,5 @@ export const showSkipBackwardLimitedNotification = () => (
soul: souls.NOTIFICATION_SKIP_BACKWARD_LIMITED, soul: souls.NOTIFICATION_SKIP_BACKWARD_LIMITED,
})); }));
}); });

/** @import {Store} from '#utv/app/interfaces' */
4 changes: 3 additions & 1 deletion projects/utv/src/watch/player/middleware.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -17,7 +17,7 @@ import * as actions from './actions';
import {playOnInitialized} from './actions/initialization'; import {playOnInitialized} from './actions/initialization';
import * as playerState from './state'; import * as playerState from './state';


/** @type {$Redux.Middleware<$UTV.Action, $UTV.State>} */ /** @type {$Redux.Middleware<Store.Action, Store.State>} */
export const playerMiddleware = ({ export const playerMiddleware = ({
dispatch, getState, dispatch, getState,
}) => (next) => (action) => { }) => (next) => (action) => {
@@ -136,3 +136,5 @@ export const playerMiddleware = ({
return next(action); return next(action);
} }
}; };

/** @import {Store} from '#utv/app/interfaces' */
6 changes: 4 additions & 2 deletions projects/utv/src/watch/player/program/actions.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -9,8 +9,8 @@ import {epgApi} from '#utv/discovery/epg/api';
*/ */
export const fetchProgramWithMarkersHandling = (programId, channel) => ( export const fetchProgramWithMarkersHandling = (programId, channel) => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
* @returns {Promise<ProgramWithMarkersHandling>} * @returns {Promise<ProgramWithMarkersHandling>}
*/ */
async (dispatch, getState) => { async (dispatch, getState) => {
@@ -35,3 +35,5 @@ export const fetchProgramWithMarkersHandling = (programId, channel) => (
* @prop {$ZAPI.EPG.DetailedCompressedProgramInfo} program * @prop {$ZAPI.EPG.DetailedCompressedProgramInfo} program
* @prop {$ZAPI.Channels.MarkerHandlingInfo} markerHandlingInfo * @prop {$ZAPI.Channels.MarkerHandlingInfo} markerHandlingInfo
*/ */

/** @import {Store} from '#utv/app/interfaces' */
4 changes: 3 additions & 1 deletion projects/utv/src/watch/player/reducer.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -4,7 +4,7 @@ import * as actionTypes from './action-types';


const INITIAL_STATE = {}; const INITIAL_STATE = {};


/** @type {$Redux.Reducer<$UTV.Watch.Player.State, $UTV.Watch.Player.Action>} */ /** @type {$Redux.Reducer<Player.State, Player.Action>} */
export const player = (state = INITIAL_STATE, action) => { export const player = (state = INITIAL_STATE, action) => {
switch (action.type) { switch (action.type) {
case actionTypes.PLAYER_SET_DATA: case actionTypes.PLAYER_SET_DATA:
@@ -37,3 +37,5 @@ export const player = (state = INITIAL_STATE, action) => {
return state; return state;
} }
}; };

/** @import {Player} from '#utv/watch/interfaces'; */
153 changes: 79 additions & 74 deletions projects/utv/src/watch/player/state.js
jmvillagra ✓ undrafted nadzeyakzattoo

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions projects/utv/src/watch/player/utils.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -31,11 +31,11 @@ const NON_LINEAR_STREAM_TYPES = [


/** /**
* @param {$Playback.UTVPlayerEventData} data * @param {$Playback.UTVPlayerEventData} data
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
*/ */
export const navigateToStreamData = (data, dispatch) => { export const navigateToStreamData = (data, dispatch) => {
/** @type {$UTV.Watch.Player.ProgramDescriptorWithID} */ /** @type {Player.ProgramDescriptorWithID} */
const descriptor = /** @type {$UTV.Watch.Player.ProgramDescriptorWithID} */ ( const descriptor = /** @type {Player.ProgramDescriptorWithID} */ (
data.state?.stream?.programDescriptor data.state?.stream?.programDescriptor
); );


@@ -102,6 +102,10 @@ export const isStreamPage = (routeName) => {
return routeName === WATCH_PAGE; return routeName === WATCH_PAGE;
}; };


/** @typedef {$ZAPI.EPG.DetailedCompressedProgramInfo} DetailedCompressedProgramInfo */ /**
* @import {Store} from '#utv/app/interfaces'
* @import {NavigationState} from '@react-navigation/core';
* @import {Player} from '#utv/watch/interfaces';
*/


/** @import {NavigationState} from '@react-navigation/core'; */ /** @typedef {$ZAPI.EPG.DetailedCompressedProgramInfo} DetailedCompressedProgramInfo */
7 changes: 5 additions & 2 deletions projects/utv/src/watch/slice.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -28,7 +28,7 @@ export const createMiddleware = () => {
return middleware; return middleware;
}; };


/** @type {$Redux.Reducer<$UTV.Watch.State>} */ /** @type {$Redux.Reducer<State>} */
export const reducer = combineReducers({ export const reducer = combineReducers({
channels: channelsSlice.reducer, channels: channelsSlice.reducer,
player, player,
@@ -40,4 +40,7 @@ export const apiReducers = {
// [watchApi.reducerPath]: watchApi.reducer, // [watchApi.reducerPath]: watchApi.reducer,
}; };


/** @import {Middleware} from '@reduxjs/toolkit' */ /**
* @import {Middleware} from '@reduxjs/toolkit'
* @import {State} from '#utv/watch/interfaces';
*/
4 changes: 3 additions & 1 deletion projects/utv/src/watch/stream/channel/middleware.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -4,7 +4,7 @@ import * as storageActions from '#utv/app/storage/actions';
import * as StorageKey from './storage-keys'; import * as StorageKey from './storage-keys';


/** /**
* @type {$Redux.Middleware<$UTV.Action, $UTV.State>} * @type {$Redux.Middleware<Store.Action, Store.State>}
*/ */
export const channel = ({dispatch}) => (next) => (action) => { export const channel = ({dispatch}) => (next) => (action) => {
switch (action.type) { switch (action.type) {
@@ -18,3 +18,5 @@ export const channel = ({dispatch}) => (next) => (action) => {
return next(action); return next(action);
} }
}; };

/** @import {Store} from '#utv/app/interfaces' */
6 changes: 4 additions & 2 deletions projects/utv/src/watch/stream/channel/state.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -7,7 +7,7 @@ import {selectWatchState} from '#utv/app/store/domains/state';
/** /**
* Returns the first available channel ID * Returns the first available channel ID
* *
* @param {$UTV.State} state * @param {Store.State} state
* @returns {string} * @returns {string}
*/ */
export const defaultChannelId = (state) => { export const defaultChannelId = (state) => {
@@ -26,7 +26,7 @@ export const defaultChannelId = (state) => {
* Returns available channel ID. If there is no channel saved to stream yet, * Returns available channel ID. If there is no channel saved to stream yet,
* it returns the default channel ID * it returns the default channel ID
* *
* @param {$UTV.State} state * @param {Store.State} state
* @returns {string} * @returns {string}
*/ */
export const currentOrDefaultChannelId = (state) => { export const currentOrDefaultChannelId = (state) => {
@@ -39,3 +39,5 @@ export const currentOrDefaultChannelId = (state) => {


return defaultChannelId(state); return defaultChannelId(state);
}; };

/** @import {Store} from '#utv/app/interfaces' */
6 changes: 4 additions & 2 deletions projects/utv/src/watch/stream/flags/program-time/utils.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -4,7 +4,7 @@ import {FlagType} from '#utv/ui/flag/orchestrator/enums';
* @param {number} startTime * @param {number} startTime
* @param {number} endTime * @param {number} endTime
* @param {boolean} [isAiring] * @param {boolean} [isAiring]
* @returns {$UTV.UI.Flag.Flags.ProgramTime} * @returns {Flag.Flags.ProgramTime}
*/ */
export const getProgramTimeFlag = (startTime, endTime, isAiring = false) => { export const getProgramTimeFlag = (startTime, endTime, isAiring = false) => {
if (!Number.isFinite(startTime) || startTime > endTime) { if (!Number.isFinite(startTime) || startTime > endTime) {
@@ -24,7 +24,7 @@ export const getProgramTimeFlag = (startTime, endTime, isAiring = false) => {
/** /**
* @param {number} startTime * @param {number} startTime
* @param {number} endTime * @param {number} endTime
* @returns {$UTV.UI.Flag.Flags.ProgramTimeDuration} * @returns {Flag.Flags.ProgramTimeDuration}
*/ */
export const getProgramTimeDurationFlag = (startTime, endTime) => { export const getProgramTimeDurationFlag = (startTime, endTime) => {
if (!Number.isFinite(startTime) || startTime > endTime) { if (!Number.isFinite(startTime) || startTime > endTime) {
@@ -39,3 +39,5 @@ export const getProgramTimeDurationFlag = (startTime, endTime) => {
}, },
}); });
}; };

/** @import {Flag} from '#utv/ui/interfaces'; */
6 changes: 4 additions & 2 deletions projects/utv/src/watch/stream/flags/utils.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -14,10 +14,10 @@ import {
* @param {$Playback.UTVPlayerStreamType} streamType * @param {$Playback.UTVPlayerStreamType} streamType
* @param {number} startTime * @param {number} startTime
* @param {number} endTime * @param {number} endTime
* @returns {$UTV.UI.Flag.OrchestratorFlagConfig[]} * @returns {Flag.OrchestratorFlagConfig[]}
*/ */
export const getFlagsConfigByStream = (streamType, startTime, endTime) => { export const getFlagsConfigByStream = (streamType, startTime, endTime) => {
/** @type {$UTV.UI.Flag.OrchestratorFlagConfig} */ /** @type {Flag.OrchestratorFlagConfig} */
const streamFlagConfig = { const streamFlagConfig = {
flagType: FlagType.STREAM_TYPE, flagType: FlagType.STREAM_TYPE,
props: {streamType}, props: {streamType},
@@ -70,3 +70,5 @@ export const getFlagsConfigByStream = (streamType, startTime, endTime) => {
return []; return [];
} }
}; };

/** @import {Flag} from '#utv/ui/interfaces'; */
6 changes: 4 additions & 2 deletions projects/utv/src/watch/stream/layout/actions.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -10,8 +10,8 @@ import {pause} from '#utv/watch/player/actions';


export const openDetails = () => ( export const openDetails = () => (
/** /**
* @param {$Redux.Dispatch<$UTV.Action>} dispatch * @param {$Redux.Dispatch<Store.Action>} dispatch
* @param {$Redux.GetState<$UTV.State>} getState * @param {$Redux.GetState<Store.State>} getState
*/ */
(dispatch, getState) => { (dispatch, getState) => {
const state = getState(); const state = getState();
@@ -45,3 +45,5 @@ export const openDetails = () => (
} }
} }
); );

/** @import {Store} from '#utv/app/interfaces' */
13 changes: 9 additions & 4 deletions projects/utv/src/watch/stream/layout/hooks.jsx
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -39,7 +39,7 @@ export const useStreamKeyHandler = (disabled, removeEnter, onAnyKey) => {
zapPrevious, zapPrevious,
} = usePlayerMethods(); } = usePlayerMethods();


/** @type {$UTV.NCE.NCECallback} */ /** @type {NCE.NCECallback} */
const onNumericChannelEntry = useCallback((channel) => { const onNumericChannelEntry = useCallback((channel) => {
dispatch(zapNumeric(channel)); dispatch(zapNumeric(channel));
}, [dispatch]); }, [dispatch]);
@@ -74,7 +74,7 @@ export const useStreamKeyHandler = (disabled, removeEnter, onAnyKey) => {
}, [seekBackward]); }, [seekBackward]);


/** /**
* @type {$UTV.KeyHandler.KeyMap} * @type {KeyHandler.KeyMap}
*/ */
const baseKeyMap = useMemo(() => ({ const baseKeyMap = useMemo(() => ({
[Keys.BACKWARD]: handleSeekBackward, [Keys.BACKWARD]: handleSeekBackward,
@@ -110,14 +110,14 @@ export const useStreamKeyHandler = (disabled, removeEnter, onAnyKey) => {
]); ]);


/** /**
* @type {$UTV.KeyHandler.KeyMap} * @type {KeyHandler.KeyMap}
*/ */
const imaAdPlaybackKeyMap = useMemo(() => ({ const imaAdPlaybackKeyMap = useMemo(() => ({
[Keys.ENTER]: requestAdSkip, [Keys.ENTER]: requestAdSkip,
[Keys.RIGHT]: openChannelList, [Keys.RIGHT]: openChannelList,
}), [openChannelList, requestAdSkip]); }), [openChannelList, requestAdSkip]);


/** @type {$UTV.KeyHandler.KeyMapOptions} */ /** @type {KeyHandler.KeyMapOptions} */
const keyMapOptions = useMemo(() => { const keyMapOptions = useMemo(() => {
const resultKeyMap = {...isAdPlayback ? imaAdPlaybackKeyMap : baseKeyMap}; const resultKeyMap = {...isAdPlayback ? imaAdPlaybackKeyMap : baseKeyMap};


@@ -160,3 +160,8 @@ export const useStreamKeyHandler = (disabled, removeEnter, onAnyKey) => {
useNumericChannelEntry(onNumericChannelEntry, disabled); useNumericChannelEntry(onNumericChannelEntry, disabled);
useKeyHandler(keyMapOptions, disabled); useKeyHandler(keyMapOptions, disabled);
}; };

/**
* @import {NCE} from '#utv/watch/interfaces';
* @import {KeyHandler} from '#utv/app/interfaces';
*/
14 changes: 8 additions & 6 deletions projects/utv/src/watch/stream/meta/state.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -9,7 +9,7 @@ import {getEpisodeString} from '#utv/discovery/details/metadata/utils';
import * as playerState from '#utv/watch/player/state'; import * as playerState from '#utv/watch/player/state';


/** /**
* @param {$UTV.State} state * @param {Store.State} state
* @returns {string} * @returns {string}
*/ */
export const streamTitle = (state) => { export const streamTitle = (state) => {
@@ -35,7 +35,7 @@ export const streamTitle = (state) => {
}; };


/** /**
* @param {$UTV.State} state * @param {Store.State} state
* @returns {string} * @returns {string}
*/ */
export const streamSubtitle = (state) => { export const streamSubtitle = (state) => {
@@ -63,7 +63,7 @@ export const streamSubtitle = (state) => {
}; };


/** /**
* @param {$UTV.State} state * @param {Store.State} state
* @returns {string} * @returns {string}
*/ */
export const logoToken = (state) => { export const logoToken = (state) => {
@@ -91,7 +91,7 @@ export const logoToken = (state) => {
}; };


/** /**
* @param {$UTV.State} state * @param {Store.State} state
* @returns {number} Start time in seconds * @returns {number} Start time in seconds
*/ */
export const streamStart = (state) => { export const streamStart = (state) => {
@@ -116,7 +116,7 @@ export const streamStart = (state) => {
}; };


/** /**
* @param {$UTV.State} state * @param {Store.State} state
* @returns {number} End time in seconds * @returns {number} End time in seconds
*/ */
export const streamEnd = (state) => { export const streamEnd = (state) => {
@@ -144,7 +144,7 @@ export const streamEnd = (state) => {
}; };


/** /**
* @param {$UTV.State} state * @param {Store.State} state
* @returns {number} * @returns {number}
*/ */
export const channelNumber = (state) => { export const channelNumber = (state) => {
@@ -174,3 +174,5 @@ export const channelNumber = (state) => {
* @prop {number} streamEnd - End time in seconds * @prop {number} streamEnd - End time in seconds
* @prop {number} channelNumber - only available for linear content * @prop {number} channelNumber - only available for linear content
*/ */

/** @import {Store} from '#utv/app/interfaces' */
4 changes: 3 additions & 1 deletion projects/utv/src/watch/stream/pin/middleware.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -15,7 +15,7 @@ import {
import * as souls from './souls'; import * as souls from './souls';


/** /**
* @type {$Redux.Middleware<$UTV.Action, $UTV.State>} * @type {$Redux.Middleware<Store.Action, Store.State>}
*/ */
const pinMiddleware = ({ const pinMiddleware = ({
dispatch, dispatch,
@@ -65,3 +65,5 @@ export const pin = [
pinMiddleware, pinMiddleware,
libPinMiddleware, libPinMiddleware,
]; ];

/** @import {Store} from '#utv/app/interfaces' */
4 changes: 3 additions & 1 deletion projects/utv/src/watch/stream/program/state.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -7,11 +7,13 @@ import * as playerState from '#utv/watch/player/state';
* Returns active program. If there is no program saved to stream yet, * Returns active program. If there is no program saved to stream yet,
* it returns the program of the default channel * it returns the program of the default channel
* *
* @param {$UTV.State} state * @param {Store.State} state
* @returns {$ZAPI.EPG.DetailedCompressedProgramInfo} * @returns {$ZAPI.EPG.DetailedCompressedProgramInfo}
*/ */
export const currentOrDefaultProgram = (state) => { export const currentOrDefaultProgram = (state) => {
const defaultChannelId = channelState.defaultChannelId(state); const defaultChannelId = channelState.defaultChannelId(state);


return playerState.streamingProgram(state) || epgState.liveProgram(state, defaultChannelId); return playerState.streamingProgram(state) || epgState.liveProgram(state, defaultChannelId);
}; };

/** @import {Store} from '#utv/app/interfaces' */
4 changes: 3 additions & 1 deletion projects/utv/src/watch/stream/recordings/middleware.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -5,7 +5,7 @@ import * as playerState from '#utv/watch/player/state';
import * as playerActions from '#utv/watch/player/actions'; import * as playerActions from '#utv/watch/player/actions';
import {NPVR_PLAYLIST_RECEIVED} from '#utv/user/recordings/action-types'; import {NPVR_PLAYLIST_RECEIVED} from '#utv/user/recordings/action-types';


/** @type {$Redux.Middleware<$UTV.Action, $UTV.State>} */ /** @type {$Redux.Middleware<Store.Action, Store.State>} */
export const recordings = ({ export const recordings = ({
dispatch, getState, dispatch, getState,
}) => (next) => (action) => { }) => (next) => (action) => {
@@ -64,3 +64,5 @@ export const recordings = ({
return next(action); return next(action);
} }
}; };

/** @import {Store} from '#utv/app/interfaces' */
4 changes: 3 additions & 1 deletion projects/utv/src/watch/stream/vod/middleware.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -4,7 +4,7 @@ import {Funnel} from '#utv/app/context/enums';
import * as playerState from '#utv/watch/player/state'; import * as playerState from '#utv/watch/player/state';
import * as playerActions from '#utv/watch/player/actions'; import * as playerActions from '#utv/watch/player/actions';


/** @type {$Redux.Middleware<$UTV.Action, $UTV.State>} */ /** @type {$Redux.Middleware<Store.Action, Store.State>} */
export const vod = ({ export const vod = ({
dispatch, getState, dispatch, getState,
}) => (next) => (action) => { }) => (next) => (action) => {
@@ -46,3 +46,5 @@ export const vod = ({
return next(action); return next(action);
} }
}; };

/** @import {Store} from '#utv/app/interfaces' */
6 changes: 4 additions & 2 deletions projects/utv/units/watch/channels/slice.test.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -60,7 +60,7 @@ const nonFavoriteTitle = mockChannels.channel15.title;
/** /**
* @param {UTVPlayerEvents} event * @param {UTVPlayerEvents} event
* @param {string} channelId * @param {string} channelId
* @returns {$UTV.Player.Actions.SetPlayerData} * @returns {Player.Actions.SetPlayerData}
*/ */
const createPlayerDataAction = (event, channelId) => setPlayerData({ const createPlayerDataAction = (event, channelId) => setPlayerData({
event, event,
@@ -76,7 +76,7 @@ const createPlayerDataAction = (event, channelId) => setPlayerData({


/** /**
* @param {string} channelId * @param {string} channelId
* @returns {$UTV.Player.Actions.SetPlayerData} * @returns {Player.Actions.SetPlayerData}
*/ */
const createPlayRequestedAction = (channelId) => createPlayerDataAction(UTVPlayerEvents.PLAY_REQUESTED, channelId); const createPlayRequestedAction = (channelId) => createPlayerDataAction(UTVPlayerEvents.PLAY_REQUESTED, channelId);


@@ -402,3 +402,5 @@ describe('Channels slice listeners', () => {
}); });
}); });
}); });

/** @import {Player} from '#utv/watch/interfaces'; */
45 changes: 25 additions & 20 deletions projects/utv/units/watch/player/actions/index.test.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -92,7 +92,7 @@ jest.mock('#utv/watch/player/state', () => ({
const originalPlayerApi = PlayerApi.current; const originalPlayerApi = PlayerApi.current;


describe('Replay', () => { describe('Replay', () => {
/** @type {() => $UTV.State} */ /** @type {() => Store.State} */
let getState; let getState;


/** @type {$Redux.Dispatch} */ /** @type {$Redux.Dispatch} */
@@ -108,7 +108,7 @@ describe('Replay', () => {
let broadcastPositionSpy; let broadcastPositionSpy;


beforeEach(() => { beforeEach(() => {
getState = jest.fn(() => (/** @type {$UTV.State} */ ({}))); getState = jest.fn(() => (/** @type {Store.State} */ ({})));
dispatch = jest.fn().mockImplementation((fn) => fn(dispatch, getState)); dispatch = jest.fn().mockImplementation((fn) => fn(dispatch, getState));


jest.spyOn(channelsLibState, 'getChannelById').mockReturnValue(MOCK_CHANNEL); jest.spyOn(channelsLibState, 'getChannelById').mockReturnValue(MOCK_CHANNEL);
@@ -134,7 +134,7 @@ describe('Replay', () => {
jest.resetAllMocks(); jest.resetAllMocks();
}); });


/** @type {$UTV.Player.PlayReplayOptions} */ /** @type {Player.PlayReplayOptions} */
const defaultOptions = { const defaultOptions = {
channelId: MOCK_CHANNEL.cid, channelId: MOCK_CHANNEL.cid,
programId: MOCK_PROGRAM.id, programId: MOCK_PROGRAM.id,
@@ -177,7 +177,7 @@ describe('Replay', () => {
}); });


it('should pass correct parameters to PlayerApi.play', async () => { it('should pass correct parameters to PlayerApi.play', async () => {
/** @type {$UTV.Player.PlayReplayOptions} */ /** @type {Player.PlayReplayOptions} */
const options = { const options = {
startPositionMs: MOCK_START_POSITION_MS, startPositionMs: MOCK_START_POSITION_MS,
...defaultOptions, ...defaultOptions,
@@ -220,7 +220,7 @@ describe('Replay', () => {
}); });


describe('Live', () => { describe('Live', () => {
/** @type {() => $UTV.State} */ /** @type {() => Store.State} */
let getState; let getState;


/** @type {$Redux.Dispatch} */ /** @type {$Redux.Dispatch} */
@@ -229,13 +229,13 @@ describe('Live', () => {
/** @type {jest.SpyInstance} */ /** @type {jest.SpyInstance} */
let trackSpy; let trackSpy;


/** @type {$UTV.Player.PlayLiveOptions} */ /** @type {Player.PlayLiveOptions} */
const defaultOptions = { const defaultOptions = {
channelId: MOCK_CHANNEL.cid, channelId: MOCK_CHANNEL.cid,
}; };


beforeEach(() => { beforeEach(() => {
getState = jest.fn(() => (/** @type {$UTV.State} */ ({}))); getState = jest.fn(() => (/** @type {Store.State} */ ({})));
dispatch = jest.fn().mockImplementation((fn) => { dispatch = jest.fn().mockImplementation((fn) => {
if (typeof fn === 'function') { if (typeof fn === 'function') {
return fn(dispatch, getState); return fn(dispatch, getState);
@@ -322,7 +322,7 @@ describe('Live', () => {
}); });


describe('zapNumeric', () => { describe('zapNumeric', () => {
/** @type {() => $UTV.State} */ /** @type {() => Store.State} */
let getState; let getState;


/** @type {$Redux.Dispatch} */ /** @type {$Redux.Dispatch} */
@@ -335,7 +335,7 @@ describe('zapNumeric', () => {
let triggerChannelNotFoundNotificationSpy; let triggerChannelNotFoundNotificationSpy;


beforeEach(() => { beforeEach(() => {
getState = jest.fn(() => (/** @type {$UTV.State} */ ({}))); getState = jest.fn(() => (/** @type {Store.State} */ ({})));
dispatch = jest.fn().mockImplementation((fn) => { dispatch = jest.fn().mockImplementation((fn) => {
if (typeof fn === 'function') { if (typeof fn === 'function') {
return fn(dispatch, getState); return fn(dispatch, getState);
@@ -399,7 +399,7 @@ describe('zapNumeric', () => {
}); });


describe('navigateToStream', () => { describe('navigateToStream', () => {
/** @type {() => $UTV.State} */ /** @type {() => Store.State} */
let getState; let getState;


/** @type {$Redux.Dispatch} */ /** @type {$Redux.Dispatch} */
@@ -415,7 +415,7 @@ describe('navigateToStream', () => {
let navigationRefGetCurrentRouteSpy; let navigationRefGetCurrentRouteSpy;


beforeEach(() => { beforeEach(() => {
getState = jest.fn(() => (/** @type {$UTV.State} */ ({}))); getState = jest.fn(() => (/** @type {Store.State} */ ({})));
dispatch = jest.fn().mockImplementation((fn) => { dispatch = jest.fn().mockImplementation((fn) => {
if (typeof fn === 'function') { if (typeof fn === 'function') {
return fn(dispatch, getState); return fn(dispatch, getState);
@@ -442,7 +442,7 @@ describe('navigateToStream', () => {
jest.resetAllMocks(); jest.resetAllMocks();
}); });


/** @type {$UTV.Player.StreamPathData} */ /** @type {Player.StreamPathData} */
const mockStreamData = { const mockStreamData = {
channelId: MOCK_CHANNEL.cid, channelId: MOCK_CHANNEL.cid,
programId: MOCK_PROGRAM.id, programId: MOCK_PROGRAM.id,
@@ -684,7 +684,7 @@ describe('navigateToStream', () => {
}); });


describe('navigateOnStreamStop', () => { describe('navigateOnStreamStop', () => {
/** @type {() => $UTV.State} */ /** @type {() => Store.State} */
let getState; let getState;


/** @type {$Redux.Dispatch} */ /** @type {$Redux.Dispatch} */
@@ -703,7 +703,7 @@ describe('navigateOnStreamStop', () => {
let isPlayerRouteActiveSpy; let isPlayerRouteActiveSpy;


beforeEach(() => { beforeEach(() => {
getState = jest.fn(() => (/** @type {$UTV.State} */ ({}))); getState = jest.fn(() => (/** @type {Store.State} */ ({})));
dispatch = jest.fn().mockImplementation((fn) => { dispatch = jest.fn().mockImplementation((fn) => {
if (typeof fn === 'function') { if (typeof fn === 'function') {
return fn(dispatch, getState); return fn(dispatch, getState);
@@ -909,11 +909,11 @@ describe('navigateOnStreamStop', () => {
}); });


describe('isPlaybackActiveOrPlayRequested', () => { describe('isPlaybackActiveOrPlayRequested', () => {
/** @type {() => $UTV.State} */ /** @type {() => Store.State} */
let getState; let getState;


beforeEach(() => { beforeEach(() => {
getState = jest.fn(() => (/** @type {$UTV.State} */ ({}))); getState = jest.fn(() => (/** @type {Store.State} */ ({})));
/** @type {jest.Mock} */ (playerState.isInitialized).mockReturnValue(true); /** @type {jest.Mock} */ (playerState.isInitialized).mockReturnValue(true);
}); });


@@ -962,15 +962,15 @@ describe('isPlaybackActiveOrPlayRequested', () => {
}); });


describe('pauseOrStopPlayback', () => { describe('pauseOrStopPlayback', () => {
/** @type {() => $UTV.State} */ /** @type {() => Store.State} */
let getState; let getState;
/** @type {$Redux.Dispatch} */ /** @type {$Redux.Dispatch} */
let dispatch; let dispatch;
/** @type {jest.SpyInstance} */ /** @type {jest.SpyInstance} */
let canPauseSpy; let canPauseSpy;


beforeEach(() => { beforeEach(() => {
getState = jest.fn(() => (/** @type {$UTV.State} */ ({}))); getState = jest.fn(() => (/** @type {Store.State} */ ({})));
dispatch = jest.fn().mockImplementation((fn) => (typeof fn === 'function' ? fn(dispatch, getState) : fn)); dispatch = jest.fn().mockImplementation((fn) => (typeof fn === 'function' ? fn(dispatch, getState) : fn));


canPauseSpy = jest.spyOn(playerState, 'canPause'); canPauseSpy = jest.spyOn(playerState, 'canPause');
@@ -1013,13 +1013,13 @@ describe('pauseOrStopPlayback', () => {
}); });


describe('Deeplink actions', () => { describe('Deeplink actions', () => {
/** @type {() => $UTV.State} */ /** @type {() => Store.State} */
let getState; let getState;
/** @type {$Redux.Dispatch} */ /** @type {$Redux.Dispatch} */
let dispatch; let dispatch;


beforeEach(() => { beforeEach(() => {
getState = jest.fn(() => (/** @type {$UTV.State} */ ({}))); getState = jest.fn(() => (/** @type {Store.State} */ ({})));
dispatch = jest.fn(); dispatch = jest.fn();


// Mock common player state functions // Mock common player state functions
@@ -1355,3 +1355,8 @@ describe('Seek actions', () => {
}); });
}); });
}); });

/**
* @import {Store} from '#utv/app/interfaces'
* @import {Player} from '#utv/watch/interfaces'
*/
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -50,7 +50,7 @@ jest.mock('#utv/watch/player/state', () => ({
})); }));


describe('playOnInitialized', () => { describe('playOnInitialized', () => {
/** @type {() => $UTV.State} */ /** @type {() => Store.State} */
let getState; let getState;


/** @type {$Redux.Dispatch} */ /** @type {$Redux.Dispatch} */
@@ -75,7 +75,7 @@ describe('playOnInitialized', () => {
let playLiveSpy; let playLiveSpy;


beforeEach(() => { beforeEach(() => {
getState = jest.fn(() => (/** @type {$UTV.State} */ ({}))); getState = jest.fn(() => (/** @type {Store.State} */ ({})));


dispatch = jest.fn().mockImplementation((fn) => { dispatch = jest.fn().mockImplementation((fn) => {
if (typeof fn === 'function') { if (typeof fn === 'function') {
@@ -207,3 +207,5 @@ describe('playOnInitialized', () => {
}); });
}); });
}); });

/** @import {Store} from '#utv/app/interfaces' */
6 changes: 4 additions & 2 deletions projects/utv/units/watch/player/program/actions.test.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -40,7 +40,7 @@ const MOCK_MARKER_HANDLING_INFO = {
}; };


describe('fetchProgramWithMarkersHandling', () => { describe('fetchProgramWithMarkersHandling', () => {
/** @type {() => $UTV.State} */ /** @type {() => Store.State} */
let getState; let getState;


/** @type {$Redux.Dispatch} */ /** @type {$Redux.Dispatch} */
@@ -52,7 +52,7 @@ describe('fetchProgramWithMarkersHandling', () => {
let fetchBroadcastSpy; let fetchBroadcastSpy;


beforeEach(() => { beforeEach(() => {
getState = jest.fn(() => (/** @type {$UTV.State} */ ({}))); getState = jest.fn(() => (/** @type {Store.State} */ ({})));
dispatch = jest.fn().mockImplementation((fn) => { dispatch = jest.fn().mockImplementation((fn) => {
if (typeof fn === 'function') { if (typeof fn === 'function') {
return fn(dispatch, getState); return fn(dispatch, getState);
@@ -91,3 +91,5 @@ describe('fetchProgramWithMarkersHandling', () => {
}); });
}); });
}); });

/** @import {Store} from '#utv/app/interfaces' */
6 changes: 4 additions & 2 deletions projects/utv/units/watch/stream/layout/actions.test.js
jmvillagra ✓ undrafted nadzeyakzattoo
Original file line number Original file line Diff line number Diff line change
@@ -33,7 +33,7 @@ jest.mock('#utv/watch/player/state', () => ({
})); }));


describe('Layout Actions', () => { describe('Layout Actions', () => {
/** @type {() => $UTV.State} */ /** @type {() => Store.State} */
let getState; let getState;


/** @type {$Redux.Dispatch} */ /** @type {$Redux.Dispatch} */
@@ -48,7 +48,7 @@ describe('Layout Actions', () => {
beforeEach(() => { beforeEach(() => {
mockPause = /** @type {jest.Mock} */ (pause); mockPause = /** @type {jest.Mock} */ (pause);
mockNavigate = /** @type {jest.Mock} */ (navigationRef.navigate); mockNavigate = /** @type {jest.Mock} */ (navigationRef.navigate);
getState = jest.fn(() => (/** @type {$UTV.State} */ ({}))); getState = jest.fn(() => (/** @type {Store.State} */ ({})));
dispatch = jest.fn().mockImplementation((fn) => { dispatch = jest.fn().mockImplementation((fn) => {
if (typeof fn === 'function') { if (typeof fn === 'function') {
return fn(dispatch, getState); return fn(dispatch, getState);
@@ -102,3 +102,5 @@ describe('Layout Actions', () => {
/** /**
* @typedef {jest.MockedFunction<(fn: () => object) => void>} MockDispatch * @typedef {jest.MockedFunction<(fn: () => object) => void>} MockDispatch
*/ */

/** @import {Store} from '#utv/app/interfaces' */

Unchanged files with check annotations Preview

import * as time from '@zattoo/time';
import {
VODType,
await support.keyboardPressSequence(page, [Keys.BACK]);
await support.isPaused(page);
await expect(page.getByTestId(DETAILS_CONTAINER)).toBeVisible();

Check failure on line 260 in projects/utv/e2e/playwright/integration/watch/streams/vod/movie-stream.web.test.js

GitHub Actions / E2E / utv / demo / xbox

[chrome] › projects/utv/e2e/playwright/integration/watch/streams/vod/movie-stream.web.test.js:228:9 › Vod Movie Stream › Navigation › Navigates back to previous page when pressing the BACK key

4) [chrome] › projects/utv/e2e/playwright/integration/watch/streams/vod/movie-stream.web.test.js:228:9 › Vod Movie Stream › Navigation › Navigates back to previous page when pressing the BACK key Error: expect.toBeVisible: Target page, context or browser has been closed 258 | await support.isPaused(page); 259 | > 260 | await expect(page.getByTestId(DETAILS_CONTAINER)).toBeVisible(); | ^ 261 | await expect(menuOpen).not.toBeVisible(); 262 | expect(page.url()).toContain(MOVIE_DETAILS_PATH); 263 | }); at /home/runner/work/frontend/frontend/projects/utv/e2e/playwright/integration/watch/streams/vod/movie-stream.web.test.js:260:63
await expect(menuOpen).not.toBeVisible();
expect(page.url()).toContain(MOVIE_DETAILS_PATH);
});
await expect(page.getByTestId(FULL_OSD)).toBeHidden();
await support.keyboardPress(page, Keys.LEFT);
await expect(page.getByTestId(MENU_OPEN)).toBeVisible();

Check failure on line 83 in projects/utv/e2e/playwright/integration/watch/streams/live/live.web.test.js

GitHub Actions / E2E / utv / demo / xbox

[chrome] › projects/utv/e2e/playwright/integration/watch/streams/live/live.web.test.js:62:5 › Live Stream › Stream interaction on Ads playback

3) [chrome] › projects/utv/e2e/playwright/integration/watch/streams/live/live.web.test.js:62:5 › Live Stream › Stream interaction on Ads playback Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Timed out 10000ms waiting for expect(locator).toBeVisible() Locator: getByTestId('MENU_OPEN') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 10000ms - waiting for getByTestId('MENU_OPEN') 81 | 82 | await support.keyboardPress(page, Keys.LEFT); > 83 | await expect(page.getByTestId(MENU_OPEN)).toBeVisible(); | ^ 84 | 85 | // first right press to close the menu 86 | await support.keyboardPress(page, Keys.RIGHT); at /home/runner/work/frontend/frontend/projects/utv/e2e/playwright/integration/watch/streams/live/live.web.test.js:83:51

Check failure on line 83 in projects/utv/e2e/playwright/integration/watch/streams/live/live.web.test.js

GitHub Actions / E2E / utv / demo / xbox

[chrome] › projects/utv/e2e/playwright/integration/watch/streams/live/live.web.test.js:62:5 › Live Stream › Stream interaction on Ads playback

3) [chrome] › projects/utv/e2e/playwright/integration/watch/streams/live/live.web.test.js:62:5 › Live Stream › Stream interaction on Ads playback Error: Timed out 10000ms waiting for expect(locator).toBeVisible() Locator: getByTestId('MENU_OPEN') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 10000ms - waiting for getByTestId('MENU_OPEN') 81 | 82 | await support.keyboardPress(page, Keys.LEFT); > 83 | await expect(page.getByTestId(MENU_OPEN)).toBeVisible(); | ^ 84 | 85 | // first right press to close the menu 86 | await support.keyboardPress(page, Keys.RIGHT); at /home/runner/work/frontend/frontend/projects/utv/e2e/playwright/integration/watch/streams/live/live.web.test.js:83:51
// first right press to close the menu
await support.keyboardPress(page, Keys.RIGHT);
const OSD_CHANNEL_NUMBER = page.getByTestId(osdInfoSouls.OSD_CHANNEL_NUMBER);
const OSD_RECORD = page.getByTestId(osdToolbarSouls.OSD_RECORD);
await expect(OSD_CHANNEL_NUMBER).toBeVisible();

Check failure on line 114 in projects/utv/e2e/playwright/integration/watch/osd/recording-button.web.test.js

GitHub Actions / E2E / utv / demo / xbox

[chrome] › projects/utv/e2e/playwright/integration/watch/osd/recording-button.web.test.js:108:5 › Recording button › Show Enabled Recording button

1) [chrome] › projects/utv/e2e/playwright/integration/watch/osd/recording-button.web.test.js:108:5 › Recording button › Show Enabled Recording button Error: Timed out 10000ms waiting for expect(locator).toBeVisible() Locator: getByTestId('OSD_CHANNEL_NUMBER') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 10000ms - waiting for getByTestId('OSD_CHANNEL_NUMBER') - waiting for" https://localhost:8085/live" navigation to finish... - navigated to "https://localhost:8085/live" 112 | const OSD_RECORD = page.getByTestId(osdToolbarSouls.OSD_RECORD); 113 | > 114 | await expect(OSD_CHANNEL_NUMBER).toBeVisible(); | ^ 115 | await support.isPlaying(page); 116 | 117 | await support.showFullOsd(page); at /home/runner/work/frontend/frontend/projects/utv/e2e/playwright/integration/watch/osd/recording-button.web.test.js:114:42
await support.isPlaying(page);
await support.showFullOsd(page);
const OSD_CHANNEL_NUMBER = page.getByTestId(osdInfoSouls.OSD_CHANNEL_NUMBER);
const OSD_RECORD = page.getByTestId(osdToolbarSouls.OSD_RECORD);
await expect(OSD_CHANNEL_NUMBER).toBeVisible();

Check failure on line 129 in projects/utv/e2e/playwright/integration/watch/osd/recording-button.web.test.js

GitHub Actions / E2E / utv / demo / xbox

[chrome] › projects/utv/e2e/playwright/integration/watch/osd/recording-button.web.test.js:122:5 › Recording button › Show Inactive Recording button if Recording are disabled for the user

2) [chrome] › projects/utv/e2e/playwright/integration/watch/osd/recording-button.web.test.js:122:5 › Recording button › Show Inactive Recording button if Recording are disabled for the user Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Timed out 10000ms waiting for expect(locator).toBeVisible() Locator: getByTestId('OSD_CHANNEL_NUMBER') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 10000ms - waiting for getByTestId('OSD_CHANNEL_NUMBER') - waiting for" https://localhost:8085/live" navigation to finish... - navigated to "https://localhost:8085/live" 127 | const OSD_RECORD = page.getByTestId(osdToolbarSouls.OSD_RECORD); 128 | > 129 | await expect(OSD_CHANNEL_NUMBER).toBeVisible(); | ^ 130 | await support.isPlaying(page); 131 | 132 | await support.showFullOsd(page); at /home/runner/work/frontend/frontend/projects/utv/e2e/playwright/integration/watch/osd/recording-button.web.test.js:129:42

Check failure on line 129 in projects/utv/e2e/playwright/integration/watch/osd/recording-button.web.test.js

GitHub Actions / E2E / utv / demo / xbox

[chrome] › projects/utv/e2e/playwright/integration/watch/osd/recording-button.web.test.js:122:5 › Recording button › Show Inactive Recording button if Recording are disabled for the user

2) [chrome] › projects/utv/e2e/playwright/integration/watch/osd/recording-button.web.test.js:122:5 › Recording button › Show Inactive Recording button if Recording are disabled for the user Error: Timed out 10000ms waiting for expect(locator).toBeVisible() Locator: getByTestId('OSD_CHANNEL_NUMBER') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 10000ms - waiting for getByTestId('OSD_CHANNEL_NUMBER') - waiting for" https://localhost:8085/live" navigation to finish... - navigated to "https://localhost:8085/live" 127 | const OSD_RECORD = page.getByTestId(osdToolbarSouls.OSD_RECORD); 128 | > 129 | await expect(OSD_CHANNEL_NUMBER).toBeVisible(); | ^ 130 | await support.isPlaying(page); 131 | 132 | await support.showFullOsd(page); at /home/runner/work/frontend/frontend/projects/utv/e2e/playwright/integration/watch/osd/recording-button.web.test.js:129:42
await support.isPlaying(page);
await support.showFullOsd(page);